uniform float nearPlane;
uniform float farPlane;

vec4 Stereographic(void)
{
	vec4 vertex = gl_ModelViewProjectionMatrix * gl_Vertex;
	vec3 vertexNormalized = normalize(vertex.xyz);
	return vec4(vertexNormalized.xy, (-2.0 * vertex.z - farPlane - nearPlane) / (farPlane - nearPlane), 1.0);
}

varying vec4 itemBufferTexCoords;
varying vec3 receiverPosition;

void BackProject(vec4 texCoords)
{
	itemBufferTexCoords = gl_TextureMatrix[0] * texCoords;

	receiverPosition = gl_Vertex.xyz;

	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_Position = gl_TextureMatrix[1] * gl_MultiTexCoord0;
}